package com.dong.bean.scope;

import org.springframework.beans.factory.config.CustomScopeConfigurer;
import org.springframework.beans.factory.config.Scope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
 * description
 *
 * @author Administrator 2021/09/03 14:45
 */
@Configuration
public class MyConfiguration {

    @Bean
    public static CustomScopeConfigurer customScopeConfigurer(){
        CustomScopeConfigurer customScopeConfigurer = new CustomScopeConfigurer();
        Map<String, Object> map = new HashMap<>();
        map.put("myScope",new MyScope());
        customScopeConfigurer.setScopes(map);
        return customScopeConfigurer;
    }
}
